<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>战斗历史详情</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Consolas','SFMono-Regular','Menlo','Monaco','Courier New','Microsoft YaHei', monospace;
            background: #0f1115;
            color: #e5e7eb;
            min-height: 100vh;
            padding: 16px;
            overflow-x: hidden;
        }
        /* 滚动条样式 - 极细化，用户不易感知 */
::-webkit-scrollbar {
    width: 1px !important;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
        .container { max-width: 1280px; margin: 0 auto; background: rgba(17,18,22,0.85); border-radius: 10px; padding: 16px 18px; border: 1px solid rgba(255,255,255,0.06); }
        
        .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px dashed rgba(255,255,255,.08); }
        
        .title { font-size: 20px; font-weight: 800; color: #e7ae97; }
        
        .subtitle {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.7);
            margin-top: 5px;
        }
        
        .close-btn {
            background: #e74c3c;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
        }
        
        .close-btn:hover {
            background: #c0392b;
        }
        
        .summary-grid { display:grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
        
        .summary-card { background: rgba(255,255,255,0.04); border-radius: 6px; padding: 14px; text-align:center; border:1px solid rgba(255,255,255,.06); }
        
        .summary-value { font-size: 18px; font-weight: 800; color: #e7ae97; margin-bottom:2px; }
        
        .summary-label { font-size: 11px; color: #94a3b8; text-transform: none; }
        
        .charts-section {
            margin-bottom: 30px;
        }
        
        .section-title {
            font-size: 20px;
            font-weight: bold;
            color: #e7ae97;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .charts-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-bottom: 30px;
        }
        
        .charts-grid-4 {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .chart-container { background: rgba(255,255,255,.03); border-radius: 6px; padding: 12px; border:1px dashed rgba(255,255,255,.06); }
        
        .chart-title {
            font-size: 14px;
            font-weight: bold;
            color: white;
            margin-bottom: 12px;
            text-align: center;
        }
        
        .chart-content {
            min-height: 200px;
        }
        
        .bar-chart {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .bar-item {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .bar-label {
            min-width: 120px;
            font-size: 12px;
            color: rgba(255, 255, 255, 0.8);
            text-align: right;
        }
        
        .bar-container { flex:1; height: 16px; background: rgba(255,255,255,.06); border-radius: 10px; overflow: hidden; position:relative; border:1px solid rgba(255,255,255,.04); }
        
        .bar-fill {
            height: 100%;
            border-radius: 12px;
            transition: width 0.5s ease;
            position: relative;
        }
        
        .bar-value { 
            position: absolute; 
            right: 0; 
            top: 50%; 
            transform: translateY(-50%); 
            font-size: 11px; 
            color: #fff; 
            font-weight: 700; 
            text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
          
            
            padding: 2px 6px;
            border-radius: 4px;
            white-space: nowrap;
            z-index: 10;
        }
        
        .players-section {
            margin-top: 30px;
        }
        
        .players-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
        
        .player-card { background: rgba(255,255,255,.04); border-radius:6px; padding:10px; border:1px solid rgba(255,255,255,.06); }
        
        .player-card:hover { background: rgba(255,255,255,.06); }
        
        .player-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .player-name { font-size: 14px; font-weight:800; color:#e5e7eb; }
        
        .player-rank {
            background: #e7ae97;
            color: #2c3e50;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: bold;
        }
        
        .player-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 3px;
            margin-bottom: 12px;
        }
        
        .stat-item { text-align:center; padding:6px; background: rgba(255,255,255,.05); border-radius: 4px; border:1px solid rgba(255,255,255,.06); }
        
        .stat-value {
            font-size: 12px;
            font-weight: bold;
            color: #e7ae97;
            margin-bottom: 2px;
        }
        
        .stat-label {
            font-size: 9px;
            color: rgba(255, 255, 255, 0.7);
            text-transform: uppercase;
        }
        
        .skills-section {
            margin-top: 15px;
        }
        
        .skills-title {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.9);
            margin-bottom: 10px;
            cursor: pointer;
            user-select: none;
        }
        
        .skills-title:hover {
            color: #e7ae97;
        }
        
        .skills-content {
            display: none;
            max-height: 300px;
            overflow-y: auto;
        }
        
        .skills-content.expanded {
            display: block;
        }
        
        .skill-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .skill-name {
            min-width: 120px;
            font-size: 12px;
            color: rgba(255, 255, 255, 0.8);
        }
        
        .skill-bar {
            flex: 1;
            height: 16px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            overflow: hidden;
        }
        
        .skill-bar-fill {
            height: 100%;
            background: #c0392b;
            border-radius: 8px;
            transition: width 0.3s ease;
        }
        
        .skill-stats {
            display: flex;
            gap: 15px;
            font-size: 11px;
            color: rgba(255, 255, 255, 0.7);
        }
        
        .loading {
            text-align: center;
            padding: 40px;
            font-size: 16px;
            color: rgba(255, 255, 255, 0.7);
        }
        
        .error {
            text-align: center;
            padding: 40px;
            font-size: 16px;
            color: #e74c3c;
        }
        
        /* 响应式设计 */
        @media (max-width: 1200px) {
            .charts-grid {
                grid-template-columns: 1fr;
            }
        }
        
        @media (max-width: 768px) {
            body {
                padding: 10px;
            }
            
            .container {
                padding: 15px;
            }
            
            .summary-grid {
                grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            }
            
            .player-stats {
                grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            }
        }
        
        /* 技能图表样式 - 黑灰白配色方案，紧凑设计 */
        .skill-chart-container {
            margin: 8px 0;
            padding: 8px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 6px;
            border: 1px solid rgba(128, 128, 128, 0.3);
            backdrop-filter: blur(4px);
        }

        .skill-chart-item {
            margin-bottom: 6px;
            padding: 6px 8px;
            background: rgba(40, 40, 40, 0.6);
            border-radius: 4px;
            border-left: 2px solid rgba(192, 192, 192, 0.4);
            transition: all 0.2s ease;
        }

        .skill-chart-item:hover {
            background: rgba(60, 60, 60, 0.8);
            border-left-color: rgba(255, 255, 255, 0.6);
            transform: translateX(1px);
        }

        .skill-chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }

        .skill-chart-name {
            font-weight: 600;
            color: #f0f0f0;
            font-size: 12px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
        }

        .skill-chart-percentage {
            font-weight: 700;
            color: #ffffff;
            font-size: 11px;
            background: rgba(0, 0, 0, 0.6);
            padding: 2px 6px;
            border-radius: 4px;
            border: 1px solid rgba(128, 128, 128, 0.4);
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
        }

        .skill-chart-bar-container {
            height: 6px;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 4px;
            border: 1px solid rgba(64, 64, 64, 0.6);
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
        }

        .skill-chart-bar {
            height: 100%;
            border-radius: 3px;
            transition: width 0.3s ease;
            background: linear-gradient(90deg, rgba(160, 160, 160, 0.8), rgba(192, 192, 192, 1)) !important;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
        }

        .skill-chart-stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 10px;
            color: rgba(200, 200, 200, 0.9);
        }

        .skill-chart-damage {
            font-weight: 600;
            color: #e0e0e0;
            font-size: 11px;
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
        }

        .skill-chart-count {
            color: rgba(180, 180, 180, 0.9);
            font-size: 10px;
            background: rgba(0, 0, 0, 0.4);
            padding: 1px 4px;
            border-radius: 3px;
            border: 1px solid rgba(96, 96, 96, 0.6);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div>
                <div class="title" id="pageTitle">战斗历史详情</div>
                <div class="subtitle" id="pageSubtitle">加载中...</div>
            </div>
         
        </div>
        
        <div id="loading" class="loading">
             正在加载战斗数据...
        </div>
        
        <div id="content" style="display: none;">
            <!-- 战斗概览 -->
            <div class="summary-grid" id="summaryGrid">
                <!-- 动态生成 -->
            </div>
            
            <!-- 图表区域 -->
            <div class="charts-section">
                <div class="section-title">
                     数据分析图表
                </div>
                <div class="charts-grid-4">
                    <div class="chart-container">
                        <div class="chart-title">秒伤排行榜</div>
                        <div class="chart-content">
                            <div id="dpsChart" class="bar-chart">
                                <!-- 动态生成 -->
                            </div>
                        </div>
                    </div>
                    
                    <div class="chart-container">
                        <div class="chart-title">瞬时伤害(爆发)排行榜</div>
                        <div class="chart-content">
                            <div id="avgDpsChart" class="bar-chart">
                                <!-- 动态生成 -->
                            </div>
                        </div>
                    </div>
                    
                    <div class="chart-container">
                        <div class="chart-title">伤害占比分布</div>
                        <div class="chart-content">
                            <div id="damageChart" class="bar-chart">
                                <!-- 动态生成 -->
                            </div>
                        </div>
                    </div>
                    
                    <div class="chart-container">
                        <div class="chart-title">治疗占比分布</div>
                        <div class="chart-content">
                            <div id="healingChart" class="bar-chart">
                                <!-- 动态生成 -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 玩家详情 -->
            <div class="players-section">
                <div class="section-title">
                     玩家详细数据
                </div>
                <div id="playersContent" class="players-grid">
                    <!-- 动态生成 -->
                </div>
            </div>
        </div>
    </div>
    
    <script src="history_detail.js"></script>
</body>
</html>
